<template>
  <div class="app-container">
    <el-form ref="form" :model="data" label-width="160px">
      <el-form-item label="是否通知客服：">
        <div>{{data.status | statusName}}</div>
      </el-form-item>
      <el-form-item label="通知方式：">
        <div>{{data.realValue1|getNoticeName1}} {{data.realValue2|getNoticeName2}}
          {{data.realValue3|getNoticeName3}} {{data.realValue4|getNoticeName4}}
          {{data.realValue5|getNoticeName5}}</div>
      </el-form-item>
      <el-form-item label="客服负责人：">
        <div>{{data.name}}</div>
      </el-form-item>
      <el-form-item label="邮件：">
        <div>{{data.email}}</div>
      </el-form-item>
      <el-form-item label="短信：">
        <div>{{data.mobile }}</div>
      </el-form-item>
      <el-form-item label="钉钉：">
        <div>{{data.dingding}}</div>
      </el-form-item>
      <el-form-item label="微信号：">
        <div>{{data.openid}}</div>
      </el-form-item>


    </el-form>
    <el-col :span="12" style="padding-left:120px;">
      <el-button type="primary" size="small" icon="el-icon-edit"  @click="goback" >返 回</el-button>
    </el-col>
  </div>
</template>

<script>
import { roomAlarmDetail ,  deleteRoomAlarm } from "../../api/roomalarm"
export default {
  name: "detail",
  data(){
    return{
      data:{
        id: '',
        admin_id:'',
        openid: '',
        mobile: '',
        dingding: '',
        email: '',
        name: '',
        readValue1: '',
        ctype: '',
        realValue1: '',
        realValue2: '',
        realValue3: '',
        realValue4: '',
        realValue5: '',
        realValue6: '',
      }
    }
  },
  filters: {
    statusName(status) {
      if (status == 1) {
        return '是';
      }else{
        return '否'
      }
    },
    getNoticeName1(type){
      if(type == 1){
        return '邮箱'
      }
    },
    getNoticeName2(type){
      if(type == 1){
        return '短信'
      }
    },
    getNoticeName3(type){
      if(type == 1){
        return '钉钉'
      }
    },
    getNoticeName4(type){
      if(type == 1){
        return '微信'
      }
    },
    getNoticeName5(type){
      if(type == 1){
        return '其它'
      }
    },
  },

  created() {
    this.getDetail(this.$route.query.id)
  },
  methods:{

    getDetail(id){

      roomAlarmDetail({ rid:id }).then(response => {
        this.data = response.data.data
        // console.log(this.data)
      })
    },
    goback(){
      this.$router.push('/operation/list');
    },
  }
}
</script>

<style scoped>

</style>
